Class SC_Query

Description

SQLの構築・実行を行う

  • author: LOCKON CO.,LTD.
  • version: $Id: SC_Query.php 17958 2009-04-09 10:46:35Z Seasoft $

Located in /class/SC_Query.php (line 30)


	
			
Variable Summary
mixed $conn
mixed $groupby
mixed $option
mixed $order
mixed $where
Method Summary
SC_Query SC_Query ([$dsn $dsn = ""], [boolean $err_disp = true], [boolean $new = false])
void andwhere ( $str)
void autoselect ( $col,  $table, [ $arrwhere = array()], [ $arrcon = array()])
void begin ()
void commit ()
integer count (string $table, [string $where = ""], [array $arrval = array()])
void currval ( $table,  $colname)
void delete (string $table, [string $where = ""], [array $arrval = array()])
void exec ( $str, [ $arrval = array()])
void get ( $table,  $col, [ $where = ""], [ $arrval = array()])
void getall ( $sql, [ $arrval = array()])
void getCol ( $table,  $col, [ $where = ""], [ $arrval = array()])
string getLastQuery ([boolean $disp = true])
void getone ( $sql, [ $arrval = array()])
void getrow ( $table,  $col, [ $where = ""], [ $arrval = array()])
void getsql ( $col,  $table,  $where)
integer get_auto_increment (string $table_name)
void insert (string $table, array $sqlval)
boolean isError ()
void max ( $table,  $col, [ $where = ""], [ $arrval = array()])
void min ( $table,  $col, [ $where = ""], [ $arrval = array()])
void nextval ( $table,  $colname)
void orwhere ( $str)
void query ( $n, [ $arr = ""], [ $ignore_err = false])
void rollback ()
array|null select (string $col, string $table, [string $where = ""], [array $arrval = array()])
void setgroupby ( $str)
void setlimit ( $limit)
void setlimitoffset ( $limit, [ $offset = 0], [ $return = false])
void setoffset ( $offset)
void setoption ( $str)
void setorder ( $str)
void setval ( $table,  $colname,  $data)
void setwhere ( $str)
void update (string $table, array $sqlval, [string $where = ""], [array $arradd = ""], [string $addcol = ""])
Variables
mixed $conn (line 33)
mixed $groupby (line 34)
mixed $option (line 31)
mixed $order (line 35)
mixed $where (line 32)
Methods
Constructor SC_Query (line 45)

コンストラクタ.

SC_Query SC_Query ([$dsn $dsn = ""], [boolean $err_disp = true], [boolean $new = false])
  • boolean $err_disp: エラー表示を行うかどうか
  • boolean $new: 新規に接続を行うかどうか
  • $dsn $dsn
andwhere (line 194)
void andwhere ( $str)
  • $str
autoselect (line 123)
void autoselect ( $col,  $table, [ $arrwhere = array()], [ $arrcon = array()])
  • $col
  • $table
  • $arrwhere
  • $arrcon
begin (line 111)
void begin ()
commit (line 107)
void commit ()
count (line 70)

COUNT文を実行する.

  • return: 件数
integer count (string $table, [string $where = ""], [array $arrval = array()])
  • string $table: テーブル名
  • string $where: where句
  • array $arrval: プレースホルダ
currval (line 428)
void currval ( $table,  $colname)
  • $table
  • $colname
delete (line 404)

レコードの削除

void delete (string $table, [string $where = ""], [array $arrval = array()])
  • string $table: テーブル名
  • string $where: WHERE句
  • array $arrval: プレースホルダ
exec (line 119)
void exec ( $str, [ $arrval = array()])
  • $str
  • $arrval
get (line 354)
void get ( $table,  $col, [ $where = ""], [ $arrval = array()])
  • $table
  • $col
  • $where
  • $arrval
getall (line 149)
void getall ( $sql, [ $arrval = array()])
  • $sql
  • $arrval
getCol (line 386)
void getCol ( $table,  $col, [ $where = ""], [ $arrval = array()])
  • $table
  • $col
  • $where
  • $arrval
getLastQuery (line 103)

直前に実行されたSQL文を取得する.

SC_DBconn::getLastQuery() を利用.

  • return: SQL文
string getLastQuery ([boolean $disp = true])
  • boolean $disp: trueの場合、画面出力を行う.
getone (line 365)
void getone ( $sql, [ $arrval = array()])
  • $sql
  • $arrval
getrow (line 373)
void getrow ( $table,  $col, [ $where = ""], [ $arrval = array()])
  • $table
  • $col
  • $where
  • $arrval
getsql (line 154)
void getsql ( $col,  $table,  $where)
  • $col
  • $table
  • $where
get_auto_increment (line 466)

auto_incrementを取得する.

integer get_auto_increment (string $table_name)
  • string $table_name: テーブル名
insert (line 242)

INSERT文を実行する.

void insert (string $table, array $sqlval)
  • string $table: テーブル名
  • array $sqlval: array('カラム名' => '値',...)の連想配列
isError (line 55)

エラー判定を行う.

boolean isError ()
max (line 330)
void max ( $table,  $col, [ $where = ""], [ $arrval = array()])
  • $table
  • $col
  • $where
  • $arrval
min (line 342)
void min ( $table,  $col, [ $where = ""], [ $arrval = array()])
  • $table
  • $col
  • $where
  • $arrval
nextval (line 414)
void nextval ( $table,  $colname)
  • $table
  • $colname
orwhere (line 202)
void orwhere ( $str)
  • $str
query (line 455)
void query ( $n, [ $arr = ""], [ $ignore_err = false])
  • $n
  • $arr
  • $ignore_err
rollback (line 115)
void rollback ()
select (line 90)

SELECT文を実行する.

array|null select (string $col, string $table, [string $where = ""], [array $arrval = array()])
  • string $col: カラム名. 複数カラムの場合はカンマ区切りで書く
  • string $table: テーブル名
  • string $where: WHERE句
  • array $arrval: プレースホルダ
setgroupby (line 186)
void setgroupby ( $str)
  • $str
setlimit (line 223)
void setlimit ( $limit)
  • $limit
setlimitoffset (line 172)
void setlimitoffset ( $limit, [ $offset = 0], [ $return = false])
  • $limit
  • $offset
  • $return
setoffset (line 229)
void setoffset ( $offset)
  • $offset
setoption (line 168)
void setoption ( $str)
  • $str
setorder (line 214)
void setorder ( $str)
  • $str
setval (line 441)
void setval ( $table,  $colname,  $data)
  • $table
  • $colname
  • $data
setwhere (line 210)
void setwhere ( $str)
  • $str
update (line 283)

UPDATE文を実行する.

void update (string $table, array $sqlval, [string $where = ""], [array $arradd = ""], [string $addcol = ""])
  • string $table: テーブル名
  • array $sqlval: array('カラム名' => '値',...)の連想配列
  • string $where: WHERE句
  • array $arradd: $addcol用のプレースホルダ配列
  • string $addcol: 追加カラム

Documentation generated on Tue, 28 Apr 2009 18:13:38 +0900 by phpDocumentor 1.4.2